package com.hunan.api.catv.entity.enums;


public enum Week {

    MON(1, "周一"),

    TUE(2, "周二"),

    WED(3, "周三"),

    THU(4, "周四"),

    FRi(5, "周五"),

    Sat(6, "周六"),

    Sun(7, "周日");

    private final Integer code;

    private final String value;


    Week(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static Week getResult(int code) {
        Week[] rcs = Week.values();
        for (Week rc : rcs) {
            if (rc.getCode() == code) {
                return rc;
            }
        }
        return null;
    }

    public static String getValue(Integer code) {
        Week[] rcs = Week.values();
        for (Week rc : rcs) {
            if (rc.getCode().equals(code)) {
                return rc.getValue();
            }
        }
        return null;
    }
}
